﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Canyala.Lagoon.Models
{
    public class DynamicXamlView
    {
        public readonly string Url;
        public readonly bool IsAbsoluteUri;
        public readonly string ViewModelDataType;

        internal DynamicXamlView(string url, bool isAbsoluteUri, string viewModelDataType)
        {
            Url = url;
            IsAbsoluteUri = isAbsoluteUri;
            ViewModelDataType = viewModelDataType;            
        }

        public static DynamicXamlView FromContentData(string xamlUrl, bool isAbsoluteUri, string dataType)
            { return new DynamicXamlView(xamlUrl, isAbsoluteUri, dataType); }
    
        public static DynamicXamlView FromContentData(Uri xamlUri, Type dataType)
            { return new DynamicXamlView(xamlUri.ToString(), xamlUri.IsAbsoluteUri, dataType.AssemblyQualifiedName); }

        public static DynamicXamlView FromContentData(Uri xamlUri, string dataType)
            { return new DynamicXamlView(xamlUri.ToString(), xamlUri.IsAbsoluteUri, dataType); }
    
    }
}
